
from django.views.static import serve

from django.conf.urls import url
from django.conf import settings

from app01 import views


urlpatterns = [
    url(r'index', views.index, name="index"),

    url(f"^{settings.MEDIA_URL.strip('/')}/(?P<path>.*)", serve,
        {"document_root": settings.MEDIA_ROOT}),


    url(r'^article/(\d+)', views.article, name="article"),

    url(
        r'^category/(?P<main_id>\d+)/(?P<sub_id>\d+)?',
        views.category,
        name="category"),

    url(r'^login', views.login, name="login"),
    url(r'^logout', views.logout, name="logout"),
    url(r'^comment/(\d+)', views.comment, name="comment"),

    url(r'^search', views.search, name="search"),

    url(r'^article_list', views.article_list, name="article_list"),
    url(r'^article_add', views.article_add, name="article_add"),
    url(r'^article_edit/(\d+)', views.article_edit, name="article_edit"),
    url(r'^article_delete/(\d+)', views.article_delete, name="article_delete"),


    url(r'^category_list', views.category_list, name="category_list"),
    url(r'^category_add', views.category_add, name="category_add"),
    url(r'^category_edit/(\d+)', views.category_edit, name="category_edit"),
    url(r'^category_delete/(\d+)', views.category_delete, name="category_delete"),


    url(r'^subcategory_list', views.subcategory_list, name="subcategory_list"),
    url(r'^subcategory_add', views.subcategory_add, name="subcategory_add"),
    url(r'^subcategory_edit/(\d+)', views.subcategory_edit, name="subcategory_edit"),
    url(r'^subcategory_delete/(\d+)', views.subcategory_delete, name="subcategory_delete"),


    url(r'^tag_list', views.tag_list, name="tag_list"),
    url(r'^tag_add', views.tag_add, name="tag_add"),
    url(r'^tag_edit/(\d+)', views.tag_edit, name="tag_edit"),
    url(r'^tag_delete/(\d+)', views.tag_delete, name="tag_delete"),


    url(r'^carousel_list', views.carousel_list, name="carousel_list"),
    url(r'^carousel_add', views.carousel_add, name="carousel_add"),
    url(r'^carousel_edit/(\d+)', views.carousel_edit, name="carousel_edit"),
    url(r'^carousel_delete/(\d+)', views.carousel_delete, name="carousel_delete"),


]


